const User = require("../model/user.model");
class UserService {
  async crateUser(username, password) {
    const res = await User.create({ username, password });
    // console.log('---',res.toJSON(),'toJson');
    return res;
  }
  async getUserInfo({ username }) {
    // username && Object.assign(obj,{username})
    const res = await User.findOne({ where: { username } });
    //  console.log('-=-=',res && res.toJSON(),'findOne');
    //  console.log(res.toJSON().password,'----',res.password,'--11psd');
    return res;
  }
  async updatedPsd({ username }) {
    const res = await User.update({ usename });
  }
}
module.exports = new UserService();
